package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "商店")
public class GDMall {

    @NoteField(value = "天赋商店ID")
    public static final int TALENT_SHOP_ID = 301;

    @NoteField(value = "藏宝阁のid", detail = "原来的精灵商店")
    public static final int TREASHURE_SHOP_ID = 1001;

    public enum MallType{
        /** 免费 */
        MALL_TYPE_FREE(0),
        /** 消耗道具 */
        MALL_TYPE_ITEM_COST(1),
        /** 支付 */
        MALL_TYPE_PAY(2);
        private int type;
        MallType(int type) {
            this.type = type;
        }

        public int getType() {
            return this.type;
        }
    }

    public enum ResetType{
        /** 每日重置 */
        DAILTY(1),
        /** 每周重置 */
        WEEKLY(2),
        /** 每月重置 */
        MONTHLY(3);
        private int type;
        ResetType(int type) {
            this.type = type;
        }
        public int getType() {
            return this.type;
        }
    }

    @NoteClass(value = "商店-金币商店")
    public static class GoldenMall {
        @NoteField(value = "金币商店刷新周期")
        public static String GOLD_MALL_CYCLE;
    }

    @NoteClass(value = "商品类型枚举")
    public static class ItemType {
        @NoteField(value = "默认刷新的商品")
        public static final byte T0 = 0;

        @NoteField(value = "首次刷新作弊商品")
        public static final byte T1 = 1;

        @NoteField(value = "动态加入的商品")
        public static final byte T2 = 2;
    }

    @NoteClass(value = "刷新方式枚举")
    public static class RefreshType {
        @NoteField(value = "不刷新")
        public static final byte T0 = 0;

        @NoteField(value = "刷新")
        public static final byte T1 = 1;
    }

    @NoteClass(value = "刷新周期枚举")
    public static class RefreshTimeType {
        @NoteField(value = "小时")
        public static final byte T1 = 1;

        @NoteField(value = "天")
        public static final byte T2 = 2;

        @NoteField(value = "周")
        public static final byte T3 = 3;

        @NoteField(value = "月")
        public static final byte T4 = 4;
    }

    /** 获取商店名称 */
    public static String getMallName(int mallId) {
        switch (mallId) {
            case 10:
                return "道具商店";
            case 20:
                return "英雄商店";
            case 31:
                return "秘境商店";
            case 32:
                return "演武商店";
            case 33:
                return "仙盟商店";
            case 34:
                return "寻宝商店";
            case 35:
                return "段位商店";
            case 40:
                return "技能商店";
            case 50:
                return "皮肤商店";
            case 60:
                return "藏宝阁";
            case 70:
                return "演武场挑战券";
            case 80:
                return "知命商店";
            default:
                return "未知商店(id=" + mallId + ")";
        }
    }

    public static void initialize(ParamSheet paramSheet) {
        GoldenMall.GOLD_MALL_CYCLE = GDParamTool.getString(paramSheet,4600, "2:1:0,10,19");
    }
}
